// EDPoint3d.cpp: implementation of the EDPoint3d class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "EDPoint3d.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

EDPoint3d::EDPoint3d()
{

}

EDPoint3d::~EDPoint3d()
{
}

EDPoint3d::EDPoint3d (
	const EDSQLExpression& exp0,
	const EDSQLExpression& exp1,
	const EDSQLExpression& exp2 )
	: x ( exp0 ), y ( exp1 ), z ( exp2 )
{
}

EDPoint3d::EDPoint3d (
	const CString& str0,
	const CString& str1,
	const CString& str2 )
	: x ( str0 ), y ( str1 ), z ( str2 )
{
}

EDPoint3d& EDPoint3d::operator = ( const EDPoint3d& pt )
{
	x = pt.x;
	y = pt.y;
	z = pt.z;
	return *this;
}

EDPoint3d& EDPoint3d::operator = ( const AcGePoint3d& pt )
{
	x.m_strExpression.Format ( _T ( "%f" ), pt.x );
	y.m_strExpression.Format ( _T ( "%f" ), pt.y );
	z.m_strExpression.Format ( _T ( "%f" ), pt.z );
	return *this;
}

void EDPoint3d::Replace ( const CVarArray* pVarAr, const int nStart )
{
	EDSQLExpression::Replace ( &x, pVarAr, nStart );
	EDSQLExpression::Replace ( &y, pVarAr, nStart );
	EDSQLExpression::Replace ( &z, pVarAr, nStart );
}

BOOL EDPoint3d::IsSingleDigital()
{
	if ( !EDSQLExpression::IsSingleDigitalVar ( &x ) )
		return FALSE;
	if ( !EDSQLExpression::IsSingleDigitalVar ( &y ) )
		return FALSE;
	if ( !EDSQLExpression::IsSingleDigitalVar ( &z ) )
		return FALSE;

	return TRUE;
}

void EDPoint3d::Set (
	const EDSQLExpression& exp0,
	const EDSQLExpression& exp1,
	const EDSQLExpression& exp2 )
{
	x = exp0;
	y = exp1;
	z = exp2;
}

void EDPoint3d::Set (
	const CString& str0,
	const CString& str1,
	const CString& str2 )
{
	x.m_strExpression = str0;
	y.m_strExpression = str1;
	z.m_strExpression = str2;
}